<%@ page language="java" contentType="text/html; charset=utf-8"
 pageEncoding="utf-8"%>
<%@page import="com.AAL.Model.TypeOfAuto"%>
<%@page import="java.util.List"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>


<h3 style="background-color: #8AC0E9; font-size:17px; width: 95%; padding: 10px ;color: white;">Quản lý danh sách hợp đồng</h3>
<s:url id="Coodinator_preEditAndAddPurchaseContracts" value="/Coodinator_preEditAndAddPurchaseContracts" />
<sj:a title="Quan ly danh sach hop dong"
	id="lnkCoodinator_preEditAndAddPurchaseContracts" href="%{Coodinator_preEditAndAddPurchaseContracts}"
	targets="container" button="true" buttonIcon="new" cssStyle="float:right; margin-right:35px;">
	Thêm mới
</sj:a>

<br />

<p style="clear: both;"></p>
	<div style="margin: 10px;"><s:form id="form" method="post"
	action="#" theme="simple" cssClass="yform">
	<fieldset style="width: 95%;"><legend
		style="margin-left: 10px; font-weight: bold;">Tim kiếm hợp đồng</legend>
	<div class="type-text">
	<ul class="form">
		<li class="left">Từ ngày:</li>
		<li class="right"><sj:datepicker name="DateBegin" label="Từ ngày"
				readonly="true" /></li>
		<li class="clr"></li>
		<li class="left">Đến ngày :</li>
		<li class="right"><sj:datepicker name="DateEnd" label="Đến ngày"
				readonly="true" /></li>
		<li class="clr"></li>
		<li class="left">Trạng thái :</li>
		<li class="right"><s:select label="Trạng thái" list="listStatusContract" listKey="StatusOfContractID"
			listValue="StatusName" name="status.StatusOfContractID" /></li>
		<li class="clr"></li>
		<li class="clr"></li>
		<li class="clr"></li>
		<li class="left">&nbsp;</li>	
		<li class="right"><s:url id="searchProduct" value="/#" /> <sj:submit
           title="Tim kiếm" id="subSearchProduct"
           href="%{searchProduct}" button="true" value="Tim kiếm"></sj:submit>
        </li>
		<li class="clr"></li>
	</ul>
	</div>

	</fieldset>
</s:form></div>

	
<div style="margin: 10px;">
	<fieldset style="width: 95%;"><legend
		style="margin-left: 10px; font-weight: bold;">Danh sách các hợp đồng</legend>
	<div class="type-text">

<table width="99%" cellpadding="0" cellspacing="0" id="box-table-a"
	summary="Employee Pay Sheet">
	<thead>
		<tr>
			<th width="3%" scope="col">STT</th>
			<th width="15%" scope="col">Mã hợp đồng</th>
			<th width="15%" scope="col">Đơn vị cung cấp</th>			
			<th width="15%" scope="col">Ngày ra hợp đồng</th>
			<th width="20%" scope="col">Ngày hết hợp đồng</th>
			<th width="15%" scope="col">Trạng thái</th>
			<th width="10%" scope="col"></th>
			<th width="5%" scope="col"></th>
			<th width="5%" scope="col"></th>
		</tr>
	</thead>
	<tbody>
		<% int i=1; %>
		<s:iterator value="listcontract">
		<tr>
			<tr>
			<td width="7%" scope="col"><%=i++ %></td>
			<td width="7%" scope="col"><s:property value="purchaseContractID" /></td>
			<td width="10%" scope="col"><s:property value="addressOfProvider" /></td>
			<td width="8%" scope="col"><s:date name="contractDate" format="dd/MM/yyyy" /></td>
			<td width="8%" scope="col"><s:date format="dd/MM/yyyy" name="deliveryDate" /></td>
			<td width="15%" scope="col">
				<s:property value="StatusOfContract.StatusName" />
			</td>
		    <td width="20%" scope="col">  	    
		    <s:url id="Coodinator_getPurchaseContract"
            value="/Coodinator_getPurchaseContract?id=%{purchaseContractID}" /> 
            <sj:a title="Thong tin chi tiet" 
            href="%{Coodinator_getPurchaseContract}" targets="container" class="link">Xem chi tiết
            </sj:a>
			</td>	
			<td width="5%" scope="col">
			<s:url id="Coodinator_preEditAndAddPurchaseContracts"
            value="/Coodinator_preEditAndAddPurchaseContracts?id=%{purchaseContractID}" /> 
            <sj:a title="Sua" 
            href="%{Coodinator_preEditAndAddPurchaseContracts}" targets="container" class="link">Sửa
            </sj:a>
			</td>
			<td width="5%" scope="col">
			<s:url id="Coodinator_deletePurchaseContract"
            value="/Coodinator_deletePurchaseContract?id=%{purchaseContractID}" /> 
            <sj:a title="Xoa" 
            href="%{Coodinator_deletePurchaseContract}" targets="container" class="link"> Xóa
            </sj:a>
			</td>
		</tr>
		<tr></tr>
		</s:iterator>
		<tr class="footer">
			<td colspan="2">&nbsp;</td>
			<td align="right">&nbsp;</td>
			<td colspan="3" align="right">
			
			<!--  PAGINATION START  -->
			<div class="pagination"><span class="previous-off">&laquo;
			Previous</span> <span class="active">1</span> <a href="#">2</a> <a href="#">3</a>
			<a href="#">4</a> <a href="#">5</a> <a href="#" class="next">Next
			&raquo;</a></div>
			<!--  PAGINATION END  --></td>
			
		</tr>
		   
	</tbody>
</table>
</div>

	</fieldset>
</div>
